package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Chunsheng Zhang 尚硅谷
 * @create 2021/11/12 14:52
 */
@Controller         //springMVC中装配请求处理器，只能用@Controller注解
public class HelloController{

    @RequestMapping(value = "/")
    public String toIndex(){
        int a = 10;
        int b =20;
        System.out.println("HelloController=>toIndex()$$$");
        //逻辑视图名
        return "index";
    }

    @RequestMapping(value = "/toHello")
    public String toHello(){
        System.out.println("HelloController=>toHello()@@@");
        //逻辑视图名
        return "hello";
    }
}
